/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sirtet.tetris.gui.fancy;

import java.awt.Image;
import java.awt.Toolkit;

/**
 *
 * @author pigpag
 */
public class FancyResource {

    public static int COLOR_NULL = 0;
    public static int COLOR_RED = 1;
    public static int COLOR_YELLOW = 5;
    public static int COLOR_BLUE = 3;
    public static int COLOR_GREEN = 4;
    public static int COLOR_GRAY = 2;
    private static Toolkit tool = Toolkit.getDefaultToolkit();

    public static int generateRandomColorIndex() {
        int v = (int) (Math.random() * 4) + 1;
        if (v == 2) {
            v = 5;
        }
        return v;
    }
    private Image[] images;
    private Image[] cautionImages;
    private Image gameoverImage;

    public Image getColorImage(int colorIndex) {
        return images[colorIndex];
    }

    public Image getCautionImage(int cautionLevel) {
        return cautionImages[cautionLevel];
    }

    public Image getGameoverImage() {
        return gameoverImage;
    }

    public FancyResource() {
        images = new Image[6];

        images[COLOR_RED] = tool.getImage("./images/red.png");
        images[COLOR_YELLOW] = tool.getImage("./images/yellow.png");
        images[COLOR_BLUE] = tool.getImage("./images/blue.png");
        images[COLOR_GREEN] = tool.getImage("./images/green.png");
        images[COLOR_GRAY] = tool.getImage("./images/gray.png");

        cautionImages = new Image[3];

        cautionImages[1] = tool.getImage("./images/caution.png");
        cautionImages[2] = tool.getImage("./images/warning.png");

        gameoverImage = tool.getImage("./images/lose.png");
    }
}
